<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page isELIgnored="false" %>
<%@ include file="/WEB-INF/views/common/includes.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<div class="span-16 last table">		
  <h3><fmt:message key="section.admin.list.user.header"/> (<fmt:message key="message.generic.table.total.upper"/> ${paginator.size})</h3>
  
  <table>
	<thead>
	  <tr>
		<th class="sortable" order="name"><fmt:message key="organization.field.name"/></th>
		<th class="sortable" order="domain"><fmt:message key="organization.field.domain"/></th>
		<th class="sortable" order="cif"><fmt:message key="organization.field.cif"/></th>
		<th><fmt:message key="message.generic.table.actions"/></th>
	  </tr>
	</thead>
	<tbody>
	<c:forEach items="${organizations}" var="org" varStatus="counter">
	  <tr>
		<td><a href="<c:url value="/${rc.locale.language}/admin/organization/detail/${org.id}/"/>" >${org.name}</a></td>
		<td>${org.domain}</td>
		<td>${org.cif}</td>
		<td>
		  <div id="menu-item-${counter.count}" class="options-menu">		
			<a class="expand-menu" href="#menu-item-${counter.count}"><fmt:message key="message.generic.options"/></a>
			<br>
			<ul class="content-options-menu" style="display: none">
			<sec:authorize ifAllGranted="ROLE_ROOT">
			  <li><a href="<c:url value="/${rc.locale.language}/admin/organization/edit/${org.id}/"/>" ><fmt:message key ="action.organization.edit" /></a></li>
			  <li><a href="<c:url value="/${rc.locale.language}/admin/organization/delete/${org.id}/"/>" ><fmt:message key ="action.organization.delete" /></a></li>
			</sec:authorize>
			</ul>
		  </div>
		</td>
	  </tr>
	</c:forEach>
	</tbody>
  </table>
</div>
<div class="span-16 last table_actions">			
  <a href='<c:url value='/${rc.locale.language}/admin/organization/'/>' title='<fmt:message key="action.organization.add" />'><fmt:message key="action.organization.add"/></a>
</div>